home *** CD-ROM | disk | FTP | other *** search
- Path: nyx10.cs.du.edu!not-for-mail
- From: ghuntres@nyx10.cs.du.edu (Gary huntress)
- Newsgroups: comp.lang.c
- Subject: Unix Serial Port Programming
- Date: 22 Jan 1996 07:24:45 -0700
- Organization: Nyx, Public Access Unix (sponsored by U. of Denver Math/CS dept.)
- Message-ID: <4e06nd$kdl@nyx10.cs.du.edu>
- NNTP-Posting-Host: nyx10.nyx.net
- X-Disclaimer: Nyx is a public access Unix system run by the University of
- Denver for the Denver community. The University has neither
- control over nor responsibility for the opinions of users.
-
-
- I posted this in comp.os.linux.misc a few days ago and I'm surprised
- that I've gotten no responses. I'm hoping that someone here is
- familiar with unix serial ports.
-
- regards,
-
- gh
- /*************************************************/
- Hi,
-
- I'm about to start a new project in an unfamiliar programming area, serial
- ports. I bought a "micro-lan" development kit from Dallas Semiconductor.
- It allows temperature probes, addressable switches and other stuff to be
- read/written using only a twisted pair. Unfortunatly, all of their software
- is in windows .DLLs and some example application level stuff, so I have to
- start from scratch configuring the serial port (baud rate etc) and
- reading/writing single bits. Their programming model is the traditional 8
- word "brick" located at the base address for each DOS comm port, then they
- twiddle the bits individually for their configuration (i.e. setting the
- baud rate to exactly 10473 bps to achieve their port timing requirements) by
- using outp().
-
- So, my question is: What is the generic programming "model" for a serial
- port under linux? I know I can fopen("/dev/mouse","r") and read a char, but
- can I write to it too? (I tried, but I have no way to know if it worked).
- How do I access the remaining 7 bytes in the "brick" (i.e. base addr+7)
- I sort of assume that I have to open() or fopen() the device (probably not
- stream, I imagine). Also, regarding the device, what is the diff between
- /dev/cua* and /dev/ttyS* ?
-
- I can see that this is getting too hard already, drat...
-
-
- Gary Huntress
- huntress@rs2.npt.nuwc.navy.mil
- ghuntres@nox.cs.du.edu
-